using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace Backend.JYD.AModel.Models.Mapping
{
    public class TaskStepModelPropertyMap : EntityTypeConfiguration<TaskStepModelProperty>
    {
        public TaskStepModelPropertyMap()
        {
            // Primary Key
            this.HasKey(t => t.StepPropertyId);

            // Properties
            this.Property(t => t.TableName)
                .HasMaxLength(20);

            this.Property(t => t.FieldName)
                .HasMaxLength(20);

            this.Property(t => t.Remark)
                .IsRequired()
                .HasMaxLength(100);

            this.Property(t => t.CodeType)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("TaskStepModelProperty");
            this.Property(t => t.StepPropertyId).HasColumnName("StepPropertyId");
            this.Property(t => t.TaskModeId).HasColumnName("TaskModeId");
            this.Property(t => t.StepId).HasColumnName("StepId");
            this.Property(t => t.TableName).HasColumnName("TableName");
            this.Property(t => t.FieldName).HasColumnName("FieldName");
            this.Property(t => t.OrderIndex).HasColumnName("OrderIndex");
            this.Property(t => t.Remark).HasColumnName("Remark");
            this.Property(t => t.CodeType).HasColumnName("CodeType");
            this.Property(t => t.Type).HasColumnName("Type");
            this.Property(t => t.Status).HasColumnName("Status");
            this.Property(t => t.CreateTime).HasColumnName("CreateTime");
            this.Property(t => t.UpdateTime).HasColumnName("UpdateTime");
            this.Property(t => t.OpId).HasColumnName("OpId");
        }
    }
}
